package org.dylan.common.model;

import org.springframework.util.Assert;

/**
 * 数据排序
 * 
 * @author dylan
 * 
 */
public final class OrderBy {
	private String field;
	private Direction order = Direction.ASC;

	public static enum Direction {
		DESC, ASC
	};

	public OrderBy(String field) {
		Assert.notNull(field);
		this.field = field;
	}

	public OrderBy(String field, Direction order) {
		Assert.notNull(field);
		this.field = field;
		this.order = order;
	}

	public String field() {
		return field;
	}

	public Direction order() {
		return order;
	}

}
